import request from '@/utils/request'

// 查询管理费费率主列表
export function listFundManagementRateMain(query) {
  return request({
    url: '/rate/fundManagementRateMain/list',
    method: 'get',
    params: query
  })
}

// 查询管理费费率主详细
export function getFundManagementRateMain(id) {
  return request({
    url: '/rate/fundManagementRateMain/' + id,
    method: 'get'
  })
}

// 根据基金ID获取费率各阶段中再投本金计算方式
export function getCapitalCalTypeByFundId(fundId) {
  return request({
    url: '/rate/fundManagementRateMain/getCapitalCalTypeByFundId/' + fundId,
    method: 'get'
  })
}

// 保存管理费费率主
export function saveFundManagementRateMain(data) {
  return request({
    url: '/rate/fundManagementRateMain/save',
    method: 'post',
    data: data
  })
}

// 删除管理费费率主
export function delFundManagementRateMain(id) {
  return request({
    url: '/rate/fundManagementRateMain/' + id,
    method: 'delete'
  })
}

// 导出管理费费率主
export function exportFundManagementRateMain(query) {
  return request({
    url: '/rate/fundManagementRateMain/export',
    method: 'get',
    params: query
  })
}

// 获取初始化出资人费率
export function initDetails(fundId, phase) {
  return request({
    url: '/rate/fundManagementRateMain/initDetails/' + fundId + '/' + phase,
    method: 'post'
  })
}

// 根据基金ID和基金期限，获取单条信息
export function getByFundIdAndPhase(query) {
  return request({
    url: '/phase/fundPhase/getByFundIdAndPhase',
    method: 'get',
    params: query
  })
}

// 校验表单中的期限是否已经存在，防止重复录入
export function checkFundPhase(data) {
  return request({
    url: '/rate/fundManagementRateMain/checkFundPhase',
    method: 'post',
    data: data
  })
}
